<? if (isset($deleted)): ?>
	<a href="/admin/comments/">Все записи</a>
<? else: ?>
	<a href="/admin/comments/deleted">Удаленные записи</a>
<? endif; ?>


<? if (empty($comments)): ?>
	Комментариев нет
<? else: ?>

<table>
	<tr>
		<th>Статья</th>
		<th>id</th>
		<th>Автор</th>
		<th>Текст</th>
		<th>Дата</th>
		<th></th>
	</tr>

	<? foreach ($comments as $val): ?>

	<tr>
		<td>
			<a href="<?=base_url().$articles[$val->tArticle]->blogUrl.'/'.$articles[$val->tArticle]->pUrl?>#comment_<?=$val->id?>" target="_blank"><?=$articles[$val->tArticle]->pName?></a>
		</td>
		<td><?=$val->id?></td>
		<td><a href="<?=base_url()?>admin/users/edit/<?=$val->tUser?>"><?=$users[$val->tUser]?></a></td>
		<td class="textTD"><?=$val->pText?></td>
		<td><?=printDate($val->dCreated, true)?></td>
		<td><?=($val->dDeleted)?
			'<span data-manage="3" data-art="'.$val->id.'" class="linkStyled manageButton">Восстановить</span>':
			'<span data-manage="2" data-art="'.$val->id.'" class="linkStyled manageButton">Удалить</span>'?>
		</td>
	</tr>

	<? endforeach; ?>
</table>
	<?=$pagination?>

<? endif; ?>